package com.wl.system.api.domain;


import com.baomidou.mybatisplus.annotation.TableName;
import com.wl.common.core.constant.ConstantSystem;
import com.wl.common.mybatis.model.AbstractBaseDeleteModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.time.LocalDateTime;

/**
 * @author: wanglin
 * @date: 2023-05-30 周二
 * @Version: 1.0
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity(name = SysUser.TABLE_NAME)
@Table(appliesTo = SysUser.TABLE_NAME, comment = "用户表")
@TableName(value = SysUser.TABLE_NAME)
public class SysUser extends AbstractBaseDeleteModel {
    public static final String TABLE_NAME = ConstantSystem.TABLE_PREFIX + "user";

    @Column(columnDefinition = "varchar(32) comment '用户账号'", nullable = false)
    private String userId;
    @Column(columnDefinition = "varchar(20) comment '姓名'")
    private String name;
    //    @Column(columnDefinition = "varchar(200) comment '用户类型，参见RoleType枚举：ADMIN,COMMON;支持多个类型'")
//    private String roleType;
    @Column(columnDefinition = "varchar(64) comment '密码'", nullable = false)
    private String password;
    @Column(columnDefinition = "int(1) default 0 comment '状态,0:正常 ；1:禁用'")
    private Integer status;
    @Column(columnDefinition = "varchar(200) comment '头像'")
    private String icon;
    @Column(columnDefinition = "bit default 1 comment '是否首次登录'")
    private Boolean isFirstLogin;
    @Column(columnDefinition = "date comment '最后登录时间'")
    private LocalDateTime lastLoginTime;
    @Column(columnDefinition = "varchar(200) comment '备注信息'")
    private String description;
}
